/**
**************************************************************************************
*Founder Effect                                                                      *
*Copyright (C) 2006-2007, 5d Studios (www.5d-Studios.com)                            *
*                                                                                    *
*This library is free software; you can redistribute it and/or                       *
*modify it under the terms of the GNU Lesser General Public                          *
*License as published by the Free Software Foundation; either                        *
*version 2.1 of the License, or (at your option) any later version.                  *
*                                                                                    *
*This library is distributed in the hope that it will be useful,                     *
*but WITHOUT ANY WARRANTY; without even the implied warranty of                      *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                   *
*Lesser General Public License for more details.                                     *
*                                                                                    *
*You should have received a copy of the GNU Lesser General Public                    *
*License along with this library; if not, write to the Free Software                 *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA      *
**************************************************************************************
*/
#pragma once

#include "lunar.h"

extern "C" {
 	#include <lua.h>
 	#include <lualib.h>
 	#include <lauxlib.h>
}


/**
======================
Base class for a widget component
======================
*/
namespace gui { class Component; };
class LUA_Component //: public gui::Component
{
public:
    LUA_Component( lua_State *L ) {m_comp = NULL;};

    /** Get the create a new component */
    virtual int Create( lua_State *L );
            int Destroy( lua_State *L );
    ///** Set/Get the name of this component */
    //static int SetName( lua_State *L );
    //static int GetName( lua_State *L );

    ///** Set/Get the location */
    //static int SetLocation( lua_State *L );
    //static int GetLocation( lua_State *L );

    ///** Set/Get the size */
    //static int SetSize( lua_State *L );
    //static int GetWidth( lua_State *L );
    //static int GetHeight( lua_State *L );

    ///** Set/Get Caption */
    //static int SetCaption( lua_State *L );
    //static int GetCaption( lua_State *L );

    ///** Set/Get background color */
    //static int SetBackgroundColor( lua_State *L );
    //static int GetBackgroundColor( lua_State *L );
    ///** Set/Get Alpha */
    //static int SetAlpha( lua_State *L );
    //static int GetAlpha( lua_State *L );

    ///** Set/Get focus */
    //static int SetFocus( lua_State *L );
    //static int HasFocus( lua_State *L );

    /** Set/Get the name of this component */
    int SetName( lua_State *L );
    int GetName( lua_State *L );

    /** Set/Get the location */
    int SetLocation( lua_State *L );
    int GetLocation( lua_State *L );

    /** Set/Get the size */
    int SetSize( lua_State *L );
    int GetWidth( lua_State *L );
    int GetHeight( lua_State *L );

    /** Set/Get Caption */
    int SetCaption( lua_State *L );
    int GetCaption( lua_State *L );

    /** Set/Get background color */
    int SetBackgroundColor( lua_State *L );
    int GetBackgroundColor( lua_State *L );
    /** Set Foreground color */
    int SetForegroundColor( lua_State *L );
    /** Get Foreground color */
    int GetForegroundColor( lua_State *L );

    /** Set/Get Alpha */
    int SetAlpha( lua_State *L );
    int GetAlpha( lua_State *L );

    /** Set/Get focus */
    int SetFocus( lua_State *L );
    int HasFocus( lua_State *L );

    /** Set/Get visibility */
    int SetVisible( lua_State *L );
    int IsVisible( lua_State *L );

    static const char className[];
    static       Lunar<LUA_Component>::RegType methods[];
protected:
    gui::Component*  m_comp;
public:
    virtual ~LUA_Component(void);
};
